package com.bfly.mall.user.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.bfly.core.base.entity.BaseEntity;

import java.io.Serializable;
import java.util.Date;

/**
 * 微信小程序用户
 *
 * @author 长沙商脉科技有限公司
 * @date 2020/9/15 21:25
 */
@TableName(value = "user",resultMap = "UserResultMap")
public class User extends BaseEntity implements Serializable {

    private static final long serialVersionUID = -6482937345835909014L;

    /**
     * 用户绑定的手机号
     * @author 长沙商脉科技有限公司
     * @date 2021/1/5 16:56
     */
    private String phone;

    /**
     * 来自哪个平台
     * @see com.bfly.mall.user.enums.PlatformType
     * @author 长沙商脉科技有限公司
     * @date 2020/9/18 16:15
     */
    @TableField("platform")
    private int platform;

    /**
     * 来自平台ID（当公众号或小程序存在多个的情况下是具体平台的ID值）
     * @author 长沙商脉科技有限公司
     * @date 2021/1/5 17:20
     */
    @TableField("platform_id")
    private int platformId;

    /**
     * 平台名称
     * @author 长沙商脉科技有限公司
     * @date 2021/1/5 17:22
     */
    @TableField(exist = false)
    private String platformName;

    @TableField("open_id")
    private String openId;

    @TableField("nick_name")
    private String nickName;

    @TableField("avatar_url")
    private String avatarUrl;

    /**
     * @see com.bfly.mall.user.enums.GenderType
     * @author 长沙商脉科技有限公司
     * @date 2020/11/28 13:43
     */
    private int gender;

    @TableField("last_login_date")
    private Date lastLoginDate;

    @TableField("last_login_ip")
    private String lastLoginIp;

    /**
     * 是否激活
     *
     * @author 长沙商脉科技有限公司
     * @date 2020/9/18 15:05
     */
    @TableField("is_enable")
    private boolean enable;

    @TableField("city")
    private String city;

    @TableField("country")
    private String country;

    @TableField("province")
    private String province;

    @TableField("language")
    private String language;

    /**
     * 公众号订阅时间
     * @author 长沙商脉科技有限公司
     * @date 2021/1/5 16:54
     */
    @TableField("subscribe_time")
    private Date subscribeTime;

    /**
     * 是否订阅了公众号
     * @author 长沙商脉科技有限公司
     * @date 2021/1/5 16:54
     */
    @TableField("is_subscribe")
    private boolean subscribe;

    public String getPlatformName() {
        return platformName;
    }

    public void setPlatformName(String platformName) {
        this.platformName = platformName;
    }

    public int getPlatformId() {
        return platformId;
    }

    public void setPlatformId(int platformId) {
        this.platformId = platformId;
    }

    public Date getSubscribeTime() {
        return subscribeTime;
    }

    public void setSubscribeTime(Date subscribeTime) {
        this.subscribeTime = subscribeTime;
    }

    public boolean isSubscribe() {
        return subscribe;
    }

    public void setSubscribe(boolean subscribe) {
        this.subscribe = subscribe;
    }

    public String getCity() {
        return city;
    }

    public void setCity(String city) {
        this.city = city;
    }

    public String getCountry() {
        return country;
    }

    public void setCountry(String country) {
        this.country = country;
    }

    public String getProvince() {
        return province;
    }

    public void setProvince(String province) {
        this.province = province;
    }

    public String getLanguage() {
        return language;
    }

    public void setLanguage(String language) {
        this.language = language;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public int getPlatform() {
        return platform;
    }

    public void setPlatform(int platform) {
        this.platform = platform;
    }

    public String getOpenId() {
        return openId;
    }

    public void setOpenId(String openId) {
        this.openId = openId;
    }

    public String getNickName() {
        return nickName;
    }

    public void setNickName(String nickName) {
        this.nickName = nickName;
    }

    public String getAvatarUrl() {
        return avatarUrl;
    }

    public void setAvatarUrl(String avatarUrl) {
        this.avatarUrl = avatarUrl;
    }

    public int getGender() {
        return gender;
    }

    public void setGender(int gender) {
        this.gender = gender;
    }

    public Date getLastLoginDate() {
        return lastLoginDate;
    }

    public void setLastLoginDate(Date lastLoginDate) {
        this.lastLoginDate = lastLoginDate;
    }

    public String getLastLoginIp() {
        return lastLoginIp;
    }

    public void setLastLoginIp(String lastLoginIp) {
        this.lastLoginIp = lastLoginIp;
    }

    public boolean isEnable() {
        return enable;
    }

    public void setEnable(boolean enable) {
        this.enable = enable;
    }
}
